package cn.ibizlab.odoo.core.odoo_calendar.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Icalendar_event;
import cn.ibizlab.odoo.core.odoo_calendar.domain.Calendar_event;
import cn.ibizlab.odoo.core.odoo_calendar.filter.Calendar_eventSearchContext;
import cn.ibizlab.odoo.core.odoo_calendar.service.ICalendar_eventService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[活动] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Calendar_eventServiceImpl implements ICalendar_eventService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Icalendar_eventClientService calendar_eventClientService;

    @Override
    public boolean update(Calendar_event calendar_event) {
        boolean bOk = false ;
        Icalendar_event clientModel = this.convert2Model(calendar_event,null);
        calendar_eventClientService.update(clientModel) ;
        this.convert2Domain(clientModel,calendar_event) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void updateBatch(List<Calendar_event> calendar_events, int batchSize) {

        //calendar_eventClientService.updateBatch(calendar_events,batchSize) ;

    }

    @Override
    public void createBatch(List<Calendar_event> calendar_events, int batchSize) {

                        //calendar_eventClientService.createBatch(calendar_events,batchSize) ;

    }

    @Override
    public Calendar_event get(Integer id) {
        Icalendar_event clientModel = calendar_eventClientService.createModel();
        clientModel.setId(id);
        calendar_eventClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Calendar_event get(Calendar_event calendar_event) {
        Calendar_event retcalendar_event = this.get(calendar_event.getId()) ;
    	BeanCopier copier=BeanCopier.create(retcalendar_event.getClass(), calendar_event.getClass(), false);
        copier.copy(retcalendar_event, calendar_event, null);
        return calendar_event ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //calendar_eventClientService.removeBatch(calendar_events) ;

    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Icalendar_event clientModel = calendar_eventClientService.createModel();
        clientModel.setId(id);
        calendar_eventClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public boolean create(Calendar_event calendar_event) {
        boolean bOk = false ;
        Icalendar_event clientModel = this.convert2Model(calendar_event,null);
        calendar_eventClientService.create(clientModel) ;
        this.convert2Domain(clientModel,calendar_event);
        bOk = true ;

        return bOk ;
    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Calendar_event> searchDefault(Calendar_eventSearchContext context) {
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据线索/商机查询
     */
    @Override
    public Page<Calendar_event> selectByOdoo_opportunity(Integer id){
        Calendar_eventSearchContext context = new Calendar_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据申请人查询
     */
    @Override
    public Page<Calendar_event> selectByOdoo_applicant(Integer id){
        Calendar_eventSearchContext context = new Calendar_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Calendar_event> selectByOdoo_create(Integer id){
        Calendar_eventSearchContext context = new Calendar_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Calendar_event> selectByOdoo_user(Integer id){
        Calendar_eventSearchContext context = new Calendar_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Calendar_event> selectByOdoo_write(Integer id){
        Calendar_eventSearchContext context = new Calendar_eventSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Calendar_event> list = new ArrayList<Calendar_event>();
        Page<cn.ibizlab.odoo.core.client.model.Icalendar_event> clientModelList = calendar_eventClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Icalendar_event clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Calendar_event>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Icalendar_event convert2Model(Calendar_event domain , Icalendar_event model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = calendar_eventClientService.createModel() ;
        }

         if(domain.getLocationDirtyFlag())
            model.setLocation(domain.getLocation());
         if(domain.getMessage_main_attachment_idDirtyFlag())
            model.setMessage_main_attachment_id(domain.getMessage_main_attachment_id());
         if(domain.getDescriptionDirtyFlag())
            model.setDescription(domain.getDescription());
         if(domain.getRecurrent_id_dateDirtyFlag())
            model.setRecurrent_id_date(domain.getRecurrent_id_date());
         if(domain.getSaDirtyFlag())
            model.setSa(domain.getSa());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getRecurrencyDirtyFlag())
            model.setRecurrency(domain.getRecurrency());
         if(domain.getCountDirtyFlag())
            model.setCount(domain.getCount());
         if(domain.getFrDirtyFlag())
            model.setFr(domain.getFr());
         if(domain.getRruleDirtyFlag())
            model.setRrule(domain.getRrule());
         if(domain.getMonth_byDirtyFlag())
            model.setMonth_by(domain.getMonth_by());
         if(domain.getWeek_listDirtyFlag())
            model.setWeek_list(domain.getWeek_list());
         if(domain.getMessage_unreadDirtyFlag())
            model.setMessage_unread(domain.getMessage_unread());
         if(domain.getStopDirtyFlag())
            model.setStop(domain.getStop());
         if(domain.getRes_idDirtyFlag())
            model.setRes_id(domain.getRes_id());
         if(domain.getMessage_has_error_counterDirtyFlag())
            model.setMessage_has_error_counter(domain.getMessage_has_error_counter());
         if(domain.getRecurrent_idDirtyFlag())
            model.setRecurrent_id(domain.getRecurrent_id());
         if(domain.getMessage_has_errorDirtyFlag())
            model.setMessage_has_error(domain.getMessage_has_error());
         if(domain.getEnd_typeDirtyFlag())
            model.setEnd_type(domain.getEnd_type());
         if(domain.getAttendee_idsDirtyFlag())
            model.setAttendee_ids(domain.getAttendee_ids());
         if(domain.getAttendee_statusDirtyFlag())
            model.setAttendee_status(domain.getAttendee_status());
         if(domain.getActiveDirtyFlag())
            model.setActive(domain.getActive());
         if(domain.getRrule_typeDirtyFlag())
            model.setRrule_type(domain.getRrule_type());
         if(domain.getIntervalDirtyFlag())
            model.setInterval(domain.getInterval());
         if(domain.getPrivacyDirtyFlag())
            model.setPrivacy(domain.getPrivacy());
         if(domain.getDurationDirtyFlag())
            model.setDuration(domain.getDuration());
         if(domain.getStart_datetimeDirtyFlag())
            model.setStart_datetime(domain.getStart_datetime());
         if(domain.getIs_attendeeDirtyFlag())
            model.setIs_attendee(domain.getIs_attendee());
         if(domain.getStart_dateDirtyFlag())
            model.setStart_date(domain.getStart_date());
         if(domain.getMoDirtyFlag())
            model.setMo(domain.getMo());
         if(domain.getStateDirtyFlag())
            model.setState(domain.getState());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getWeDirtyFlag())
            model.setWe(domain.getWe());
         if(domain.getMessage_partner_idsDirtyFlag())
            model.setMessage_partner_ids(domain.getMessage_partner_ids());
         if(domain.getDisplay_timeDirtyFlag())
            model.setDisplay_time(domain.getDisplay_time());
         if(domain.getDisplay_startDirtyFlag())
            model.setDisplay_start(domain.getDisplay_start());
         if(domain.getStop_dateDirtyFlag())
            model.setStop_date(domain.getStop_date());
         if(domain.getMessage_needactionDirtyFlag())
            model.setMessage_needaction(domain.getMessage_needaction());
         if(domain.getMessage_unread_counterDirtyFlag())
            model.setMessage_unread_counter(domain.getMessage_unread_counter());
         if(domain.getFinal_dateDirtyFlag())
            model.setFinal_date(domain.getFinal_date());
         if(domain.getRes_model_idDirtyFlag())
            model.setRes_model_id(domain.getRes_model_id());
         if(domain.getIs_highlightedDirtyFlag())
            model.setIs_highlighted(domain.getIs_highlighted());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getMessage_channel_idsDirtyFlag())
            model.setMessage_channel_ids(domain.getMessage_channel_ids());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getStop_datetimeDirtyFlag())
            model.setStop_datetime(domain.getStop_datetime());
         if(domain.getActivity_idsDirtyFlag())
            model.setActivity_ids(domain.getActivity_ids());
         if(domain.getRes_modelDirtyFlag())
            model.setRes_model(domain.getRes_model());
         if(domain.getTuDirtyFlag())
            model.setTu(domain.getTu());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getShow_asDirtyFlag())
            model.setShow_as(domain.getShow_as());
         if(domain.getCateg_idsDirtyFlag())
            model.setCateg_ids(domain.getCateg_ids());
         if(domain.getAlarm_idsDirtyFlag())
            model.setAlarm_ids(domain.getAlarm_ids());
         if(domain.getThDirtyFlag())
            model.setTh(domain.getTh());
         if(domain.getMessage_needaction_counterDirtyFlag())
            model.setMessage_needaction_counter(domain.getMessage_needaction_counter());
         if(domain.getBydayDirtyFlag())
            model.setByday(domain.getByday());
         if(domain.getDayDirtyFlag())
            model.setDay(domain.getDay());
         if(domain.getStartDirtyFlag())
            model.setStart(domain.getStart());
         if(domain.getMessage_attachment_countDirtyFlag())
            model.setMessage_attachment_count(domain.getMessage_attachment_count());
         if(domain.getPartner_idsDirtyFlag())
            model.setPartner_ids(domain.getPartner_ids());
         if(domain.getAlldayDirtyFlag())
            model.setAllday(domain.getAllday());
         if(domain.getMessage_idsDirtyFlag())
            model.setMessage_ids(domain.getMessage_ids());
         if(domain.getWebsite_message_idsDirtyFlag())
            model.setWebsite_message_ids(domain.getWebsite_message_ids());
         if(domain.getMessage_follower_idsDirtyFlag())
            model.setMessage_follower_ids(domain.getMessage_follower_ids());
         if(domain.getSuDirtyFlag())
            model.setSu(domain.getSu());
         if(domain.getMessage_is_followerDirtyFlag())
            model.setMessage_is_follower(domain.getMessage_is_follower());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getOpportunity_id_textDirtyFlag())
            model.setOpportunity_id_text(domain.getOpportunity_id_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getUser_id_textDirtyFlag())
            model.setUser_id_text(domain.getUser_id_text());
         if(domain.getPartner_idDirtyFlag())
            model.setPartner_id(domain.getPartner_id());
         if(domain.getApplicant_id_textDirtyFlag())
            model.setApplicant_id_text(domain.getApplicant_id_text());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getApplicant_idDirtyFlag())
            model.setApplicant_id(domain.getApplicant_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getUser_idDirtyFlag())
            model.setUser_id(domain.getUser_id());
         if(domain.getOpportunity_idDirtyFlag())
            model.setOpportunity_id(domain.getOpportunity_id());
        return model ;
    }

    public Calendar_event convert2Domain( Icalendar_event model ,Calendar_event domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Calendar_event();
        }

        if(model.getLocationDirtyFlag())
            domain.setLocation(model.getLocation());
        if(model.getMessage_main_attachment_idDirtyFlag())
            domain.setMessage_main_attachment_id(model.getMessage_main_attachment_id());
        if(model.getDescriptionDirtyFlag())
            domain.setDescription(model.getDescription());
        if(model.getRecurrent_id_dateDirtyFlag())
            domain.setRecurrent_id_date(model.getRecurrent_id_date());
        if(model.getSaDirtyFlag())
            domain.setSa(model.getSa());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getRecurrencyDirtyFlag())
            domain.setRecurrency(model.getRecurrency());
        if(model.getCountDirtyFlag())
            domain.setCount(model.getCount());
        if(model.getFrDirtyFlag())
            domain.setFr(model.getFr());
        if(model.getRruleDirtyFlag())
            domain.setRrule(model.getRrule());
        if(model.getMonth_byDirtyFlag())
            domain.setMonth_by(model.getMonth_by());
        if(model.getWeek_listDirtyFlag())
            domain.setWeek_list(model.getWeek_list());
        if(model.getMessage_unreadDirtyFlag())
            domain.setMessage_unread(model.getMessage_unread());
        if(model.getStopDirtyFlag())
            domain.setStop(model.getStop());
        if(model.getRes_idDirtyFlag())
            domain.setRes_id(model.getRes_id());
        if(model.getMessage_has_error_counterDirtyFlag())
            domain.setMessage_has_error_counter(model.getMessage_has_error_counter());
        if(model.getRecurrent_idDirtyFlag())
            domain.setRecurrent_id(model.getRecurrent_id());
        if(model.getMessage_has_errorDirtyFlag())
            domain.setMessage_has_error(model.getMessage_has_error());
        if(model.getEnd_typeDirtyFlag())
            domain.setEnd_type(model.getEnd_type());
        if(model.getAttendee_idsDirtyFlag())
            domain.setAttendee_ids(model.getAttendee_ids());
        if(model.getAttendee_statusDirtyFlag())
            domain.setAttendee_status(model.getAttendee_status());
        if(model.getActiveDirtyFlag())
            domain.setActive(model.getActive());
        if(model.getRrule_typeDirtyFlag())
            domain.setRrule_type(model.getRrule_type());
        if(model.getIntervalDirtyFlag())
            domain.setInterval(model.getInterval());
        if(model.getPrivacyDirtyFlag())
            domain.setPrivacy(model.getPrivacy());
        if(model.getDurationDirtyFlag())
            domain.setDuration(model.getDuration());
        if(model.getStart_datetimeDirtyFlag())
            domain.setStart_datetime(model.getStart_datetime());
        if(model.getIs_attendeeDirtyFlag())
            domain.setIs_attendee(model.getIs_attendee());
        if(model.getStart_dateDirtyFlag())
            domain.setStart_date(model.getStart_date());
        if(model.getMoDirtyFlag())
            domain.setMo(model.getMo());
        if(model.getStateDirtyFlag())
            domain.setState(model.getState());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getWeDirtyFlag())
            domain.setWe(model.getWe());
        if(model.getMessage_partner_idsDirtyFlag())
            domain.setMessage_partner_ids(model.getMessage_partner_ids());
        if(model.getDisplay_timeDirtyFlag())
            domain.setDisplay_time(model.getDisplay_time());
        if(model.getDisplay_startDirtyFlag())
            domain.setDisplay_start(model.getDisplay_start());
        if(model.getStop_dateDirtyFlag())
            domain.setStop_date(model.getStop_date());
        if(model.getMessage_needactionDirtyFlag())
            domain.setMessage_needaction(model.getMessage_needaction());
        if(model.getMessage_unread_counterDirtyFlag())
            domain.setMessage_unread_counter(model.getMessage_unread_counter());
        if(model.getFinal_dateDirtyFlag())
            domain.setFinal_date(model.getFinal_date());
        if(model.getRes_model_idDirtyFlag())
            domain.setRes_model_id(model.getRes_model_id());
        if(model.getIs_highlightedDirtyFlag())
            domain.setIs_highlighted(model.getIs_highlighted());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getMessage_channel_idsDirtyFlag())
            domain.setMessage_channel_ids(model.getMessage_channel_ids());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getStop_datetimeDirtyFlag())
            domain.setStop_datetime(model.getStop_datetime());
        if(model.getActivity_idsDirtyFlag())
            domain.setActivity_ids(model.getActivity_ids());
        if(model.getRes_modelDirtyFlag())
            domain.setRes_model(model.getRes_model());
        if(model.getTuDirtyFlag())
            domain.setTu(model.getTu());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getShow_asDirtyFlag())
            domain.setShow_as(model.getShow_as());
        if(model.getCateg_idsDirtyFlag())
            domain.setCateg_ids(model.getCateg_ids());
        if(model.getAlarm_idsDirtyFlag())
            domain.setAlarm_ids(model.getAlarm_ids());
        if(model.getThDirtyFlag())
            domain.setTh(model.getTh());
        if(model.getMessage_needaction_counterDirtyFlag())
            domain.setMessage_needaction_counter(model.getMessage_needaction_counter());
        if(model.getBydayDirtyFlag())
            domain.setByday(model.getByday());
        if(model.getDayDirtyFlag())
            domain.setDay(model.getDay());
        if(model.getStartDirtyFlag())
            domain.setStart(model.getStart());
        if(model.getMessage_attachment_countDirtyFlag())
            domain.setMessage_attachment_count(model.getMessage_attachment_count());
        if(model.getPartner_idsDirtyFlag())
            domain.setPartner_ids(model.getPartner_ids());
        if(model.getAlldayDirtyFlag())
            domain.setAllday(model.getAllday());
        if(model.getMessage_idsDirtyFlag())
            domain.setMessage_ids(model.getMessage_ids());
        if(model.getWebsite_message_idsDirtyFlag())
            domain.setWebsite_message_ids(model.getWebsite_message_ids());
        if(model.getMessage_follower_idsDirtyFlag())
            domain.setMessage_follower_ids(model.getMessage_follower_ids());
        if(model.getSuDirtyFlag())
            domain.setSu(model.getSu());
        if(model.getMessage_is_followerDirtyFlag())
            domain.setMessage_is_follower(model.getMessage_is_follower());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getOpportunity_id_textDirtyFlag())
            domain.setOpportunity_id_text(model.getOpportunity_id_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getUser_id_textDirtyFlag())
            domain.setUser_id_text(model.getUser_id_text());
        if(model.getPartner_idDirtyFlag())
            domain.setPartner_id(model.getPartner_id());
        if(model.getApplicant_id_textDirtyFlag())
            domain.setApplicant_id_text(model.getApplicant_id_text());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getApplicant_idDirtyFlag())
            domain.setApplicant_id(model.getApplicant_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getUser_idDirtyFlag())
            domain.setUser_id(model.getUser_id());
        if(model.getOpportunity_idDirtyFlag())
            domain.setOpportunity_id(model.getOpportunity_id());
        return domain ;
    }


}
